package com.ytc.file.controller;


import com.ytc.util.FileUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/file")
public class FileController {
    @RequestMapping("upload")
    @ResponseBody
    public Map<String,String> upload(MultipartFile img){
        String fileUpload = FileUtil.FileUpload(img);
        Map<String,String> map=new HashMap<String,String>();
        map.put("img", fileUpload);
        return map;
    }
}
